#!/usr/bin/env python

import random
import string
import MySQLdb as mysql

# model fields
# ---Begin---
models = ["Corolla","Camry","FJ","Supra","Land Cruiser","Yaris","RAV4","Prado"]
years = range(1996,2014)
cylinders = [4,6,8]
horse_power = range(200,501,50)
torque = range(100,160,5)
automatic = [0,1]
inline = [0,1,2]
# ---End---

# design fields
wheels = ['stock','premium','chrome','spinners','racing']
leather = [0,1]
interior_color = ['brown','black','biege']
exterior_color = ['white','black','silver','red','yellow','blue','pink']

# maintenance fields
warranty_length = [1,2,5,10,-1]

# safety fields
airbags = [0,1]
reverse_camera = [0,1]
alarm = [0,1]
onstar = [0,1]
fuel_cutoff = [0,1]

# extras fields
sport = [0,1]
cd = [0,1]
dvd = [0,1]
speakers = [0,1]
keyless_entry = [0,1]
cruise_control = [0,1]
powered_seats = [0,1]
heated_seats = [0,1]
computer = [0,1]

# handling field
power_steering = [0,1]
anti_lock = [0,1]
traction_control = [0,1]
all_wheel = [0,1]

def genModel():
    temp = ""
    temp += "'" + random.choice(models) + "',"
    temp += "'" + str(random.choice(years)) + "',"
    temp += "'" + str(random.choice(cylinders)) + "',"
    temp += "'" + str(random.choice(horse_power)) + "',"
    temp += "'" + str(random.choice(torque)) + "',"
    temp += "'" + str(random.choice(automatic)) + "',"
    temp += "'" + str(random.choice(inline)) + "'"
    return temp
    
def genDesign():
    temp = ""
    temp += random.choice(wheels) + ","
    temp += str(random.choice(leather)) + ","
    temp += random.choice(interior_color) + ","
    temp += random.choice(exterior_color) + ","
    return temp
    
if __name__ == "__main__":
    # bank = string.ascii_uppercase + string.digits
    # vins = []
    # for i in range(1000):
        # vin = ""
        # for j in range(17):
            # vin += random.choice(bank)
        # vins.append(vin)

    # file = open("vins.txt","w")
    # for vin in vins:
        # file.write(vin + "\n")
    # file.close
    # print "Model, Year, Cylinders, Horses, Torque, Automatic, Inline, Wheels, Leather, Interior, Exterior"
    file = open("vins.txt","r")
    vins = []
    for item in range(100):
        vins.append(file.readline().rstrip())
    for item in vins:
        print "INSERT INTO model(vin,name,year,cylinders,horse_power,torque,automatic,inline) VALUES(" + repr(item) + "," + genModel() + ")"